function [Boost_error, Boost_labels] = Boosting_decision_stump(data, weight, label, T)
dim = zeros(T,1);
thresh_val = zeros(T,1);
thresh_ineq = zeros(T,1);
arr_alpha = zeros(T,1);
num_row = size(data, 1);
Boost_labels = zeros(num_row, 1);
for i = 1:T
    [classifier, min_error, best_labels] = decision_stump(data, weight, label);
    % alpha>0
    alpha = 0.5 * log((1 - min_error) / min_error);
    % 更新每个样本的权重
    weight = weight .* exp(-alpha .* label .* best_labels);
    weight = weight / (sum(weight));
    % 保留分类器以及对应的权重
    dim(i) = classifier.dim;
    thresh_val(i) = classifier.thresh_val;
    thresh_ineq(i) = classifier.thresh_ineq;
    arr_alpha(i) = alpha;
end
% 利用集成分类器对实例进行预测
for i = 1:T
    predi_labels = decision(data, dim(i), thresh_val(i), thresh_ineq(i));
    Boost_labels = Boost_labels + arr_alpha(i) * predi_labels;
end
% Boost_labels中大于0就设置为1,小于0就设置为0.因为predi_labels只存在1与-1的情况
Boost_labels(Boost_labels >= 0) = 1;
Boost_labels(Boost_labels < 0) = -1;
Boost_error = sum(Boost_labels ~= label) / num_row;
end